package bman.filecopy;

import java.io.CharArrayWriter;
import java.io.File;
import java.util.ArrayList;
import java.util.List;

import bman.tools.JString;

public class Test
{

	/**
	 * @param args
	 */
	public static void main(String[] args)
	{
		String cmd = "cp 917 text.txt";
		String cmd2 = "cp 333333333333917 text.txt";
		String cmd3 = "cp 9 teddffxt.txt";
		String cmd4 = "cp 90 file1.txt file2.txt \"yumy yumy.txt\" another.file \"another space file.txt\"";
		
		String port = JString.getMatch(".+\\s(\\d+)\\s.+", cmd);
		String port2 = JString.getMatch(".+\\s(\\d+)\\s.+", cmd2);
		String port3 = JString.getMatch(".+\\s(\\d+)\\s.+", cmd3);
		String port4 = JString.getMatch(".+\\s(\\d+)\\s.+", cmd4);
		
		System.out.println(port);
		System.out.println(port2);
		System.out.println(port3);
		System.out.println(port4);
		
		String f = JString.getMatch(".+\\s\\d+\\s(.+)", cmd);
		String f2 = JString.getMatch(".+\\s\\d+\\s(.+)", cmd2);
		String f3 = JString.getMatch(".+\\s\\d+\\s(.+)", cmd3);
		String f4 = JString.getMatch(".+\\s\\d+\\s(.+)", cmd4);
		
		System.out.println(f);
		System.out.println(f2);
		System.out.println(f3);
		System.out.println(f4);
		
		System.out.println("\n\n");
		

	}
}
